<?php


//路由分组
Route::group(['prefix'=>'admin','namespace'=>'Admin'],function(){
    //登录
    Route::get('login','LoginController@index')->name('admin.login');
    Route::post('login','LoginController@login')->name('admin.login');



    Route::group(['middleware' => ['ckadmin'],'as' => 'admin.'],function(){
    //主页显示
    Route::get('index','IndexController@index')->name('index');
    //欢迎页显示
    Route::get('welcome','IndexController@welcome')->name('welcome');
    //退出
    Route::get('logout','IndexController@logout')->name('logout');

    //用户管理
        //全选删除
        Route::delete('delAll','UserController@delAll')->name('user.delAll');
        //个人修改
        Route::get('myedit','UserController@myedit')->name('user.myedit');
        Route::put('myupdate','UserController@myupdate')->name('user.myupdate');
        //给分户分配角色
        Route::match(['get','post'],'user/role/{user}','UserController@role')->name('user.role');
        //用户资源路由
        Route::resource('user','UserController');

    //角色管理
        //分配权限
        Route::get('role/node/{role}','RoleController@node')->name('role.node');
        Route::post('role/node/{role}','RoleController@nodeSave')->name('role.node');
        //角色资源路由
        Route::resource('role','RoleController');

    //节点管理
        //节点资源路由
        Route::resource('node','NodeController');

    //文章管理
        //文章资源路由
        Route::post('article/upfile','ArticleController@upfile')->name('article.upfile');
        Route::resource('article','ArticleController');

    //房源属性
        //文件上传
        Route::post('fangattr/upfile','FangAttrController@upfile')->name('fangattr.upfile');
        Route::resource('fangattr','FangAttrController');

    //房东管理
        //导出excel
        Route::get('fangowner/exports','FangOwnerController@exports')->name('fangowner.exports');
        //文件上传
        Route::post('fangowner/upfile','FangOwnerController@upfile')->name('fangowner.upfile');
        //文件删除
        Route::get('fangowner/delfile','FangOwnerController@delfile')->name('fangowner.delfile');
        Route::resource('fangowner','FangOwnerController');

    //房源管理
        //es索引
        Route::get('fang/es/init','FangController@esinit')->name('fang.esinit');
        //房源状态
        Route::get('fang/changestatus','FangController@changestatus')->name('fang.changestatus');

        //文件上传
        Route::post('fang/upfile','FangController@upfile')->name('fang.upfile');
        Route::get('fang/city','FangController@city')->name('fang.city');
        Route::resource('fang','FangController');

    //预约资源管理
        Route::resource('notice','NoticeController');

    //接口账号管理
        //恢复
        Route::post('apiuser/restore/{id}','ApiuserController@rest')->name('apiuser.restore');
        Route::resource('apiuser','ApiuserController');








    });


});
